<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ include file="/interceptor.jsp"%>
<%@page isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改数据</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
        function setit(){
            var uname=document.getElementById("name").value;
            var categoryid=document.getElementById("categoryid").value;
            var title=document.getElementById("title").value;
            if(uname == null||uname=="" ){
                alert("名称不能为空！");
                return false;
            }else if(categoryid == null||categoryid=="" ){
                alert("分类ID不能为空！");
                return false;
            }else if(title == null||title=="" ){
                alert("标题不能为空！");
                return false;
            }else if(confirm("您确定要修改数据吗？")){
                document.forms[0].submit();
            }
        }

        function back() {
            history.go(-1);
        }
	</script>
</head>

<body>
<%-- <%@ include file="login_check.jsp" %> --%>

<form id="myForm" name="myForm" action="computerupdate" method="post">
	<div class="action">
		<div class="t">
			修改数据
			<input type="hidden" name="id" value="${computer.id}" id="id"/>
		</div>
		<div class="pages">
			<table width="90%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td align="right" width="30%">名称：</td>
					<td align="left"><input type="text" name="name" id="name" value="${computer.name}" /> <font color="red">*</font></td>
				</tr>
				<tr>
					<td align="right" width="30%">分类ID：</td>
					<td align="left"><input type="text" name="categoryid" id="categoryid" value="${computer.categoryid}" /> <font color="red">*</font></td>
				</tr>
				<tr>
					<td align="right" width="30%">标题：</td>
					<td align="left"><input type="text" name="title" id="title" value="${computer.title}" /> <font color="red">*</font></td>
				</tr>
				<tr >
					<td align="center" colspan="2"><br/>
						<input type="button"  id="save" value="保存数据" onclick="setit();" />
						<input type="button"  id="re_to" value="返回" onclick="back();" />
					</td>
				</tr>
			</table>
		</div>
	</div>
</form>
</body>

</html>